<?php

namespace app\admin\model;

use think\Model;


class Appealnew extends Model
{

    

    

    // 表名
    protected $name = 'appeal_new';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'status_text',
        'type_text'
    ];
    

    
    public function getStatusList()
    {
        return ['待处理' => __('待处理'), '已处理' => __('已处理'), '拒绝处理' => __('拒绝处理'), '已取消' => __('已取消')];
    }

    public function getTypeList()
    {
        /*
        0.订单评价的申诉
1.橱窗的举报
2.用户的举报
3.发布动态的举报
4.动态评价的举报
5.动态回复的举报
6.订单评价的申诉
        */
        return ["订单评价的申诉","橱窗的举报","用户的举报","发布动态的举报","动态评价的举报","动态回复的举报","订单的申诉"];
    }


    public function getStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
        $list = $this->getStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getTypeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
        $list = $this->getTypeList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
